package com.deyuanyun.pic.pbf.controller.dto.defect.node;

import com.deyuanyun.pic.common.util.ObjectUtil;
import com.deyuanyun.pic.pbf.domain.CorrosionEnvironment;
import com.deyuanyun.pic.settings.support.biz.CodeUtil;

import java.math.BigDecimal;

/**
 * 2，腐蚀环境调查记录表
 */
public class CorrosionEnvironmentDto extends NodeDto {

    /**
     * 地下水：有；无；时有时无
     */
    private String groundwater;

    /**
     * PH值
     */
    private BigDecimal soilPh;

    /**
     * 根系植物：茂盛；中等；无；很少
     */
    private String deepRootedPlants;

    /**
     * 土壤松紧度：疏松；松；稍紧；紧；很紧
     */
    private String soilCompactness;

    /**
     * 土壤颜色
     */
    private String soilColor;

    /**
     * 土壤干湿度：干；润；潮；湿；水
     */
    private String soilHumidity;

    /**
     * 土壤颗粒组划分：粘粒组；粉粒组；砂粒组；砾粒组；卵（碎）粒组；块石
     */
    private String soilParticlesGroup;

    /**
     * 土壤电阻率
     */
    private BigDecimal soilResistivity;

    /**
     * 土壤取样编号：如果取样多个，用逗号隔开
     */
    private String soilSamplingNumber;

    /**
     * 地形地貌描述
     */
    private String terrainGeomorphology;

    /**
     * 土壤分层描述
     */
    private String soilLayer;

    /**
     * 是否完成该节点任务：0，没有完成；1，已经完成
     */
    private Short isCompletion;

    public CorrosionEnvironmentDto(Short isCompletion) {
        this.isCompletion = isCompletion;
    }

    public Short getIsCompletion() {
        return isCompletion;
    }

    public void setIsCompletion(Short isCompletion) {
        this.isCompletion = isCompletion;
    }

    public String getGroundwater() {
        return groundwater;
    }

    public void setGroundwater(String groundwater) {
        this.groundwater = groundwater;
    }

    public BigDecimal getSoilPh() {
        return soilPh;
    }

    public void setSoilPh(BigDecimal soilPh) {
        this.soilPh = soilPh;
    }

    public String getDeepRootedPlants() {
        return deepRootedPlants;
    }

    public void setDeepRootedPlants(String deepRootedPlants) {
        this.deepRootedPlants = deepRootedPlants;
    }

    public String getSoilCompactness() {
        return soilCompactness;
    }

    public void setSoilCompactness(String soilCompactness) {
        this.soilCompactness = soilCompactness;
    }

    public String getSoilColor() {
        return soilColor;
    }

    public void setSoilColor(String soilColor) {
        this.soilColor = soilColor;
    }

    public String getSoilHumidity() {
        return soilHumidity;
    }

    public void setSoilHumidity(String soilHumidity) {
        this.soilHumidity = soilHumidity;
    }

    public String getSoilParticlesGroup() {
        return soilParticlesGroup;
    }

    public void setSoilParticlesGroup(String soilParticlesGroup) {
        this.soilParticlesGroup = soilParticlesGroup;
    }

    public BigDecimal getSoilResistivity() {
        return soilResistivity;
    }

    public void setSoilResistivity(BigDecimal soilResistivity) {
        this.soilResistivity = soilResistivity;
    }

    public String getSoilSamplingNumber() {
        return soilSamplingNumber;
    }

    public void setSoilSamplingNumber(String soilSamplingNumber) {
        this.soilSamplingNumber = soilSamplingNumber;
    }

    public String getTerrainGeomorphology() {
        return terrainGeomorphology;
    }

    public void setTerrainGeomorphology(String terrainGeomorphology) {
        this.terrainGeomorphology = terrainGeomorphology;
    }

    public String getSoilLayer() {
        return soilLayer;
    }

    public void setSoilLayer(String soilLayer) {
        this.soilLayer = soilLayer;
    }

    public void fromDomain(CorrosionEnvironment domain) {

        if (ObjectUtil.isEmptyAll(domain)) {
            return;
        }

        // 地下水
        this.groundwater = CodeUtil.getName(domain.getGroundwater());
        // PH值
        this.soilPh = domain.getSoilPh();
        // 根系植物
        this.deepRootedPlants = CodeUtil.getName(domain.getDeepRootedPlants());
        // 土壤松紧度
        this.soilCompactness = CodeUtil.getName(domain.getSoilCompactness());
        // 土壤颜色
        this.soilColor = domain.getSoilColor();
        // 土壤干湿度
        this.soilHumidity = CodeUtil.getName(domain.getSoilHumidity());
        // 土壤颗粒组划分
        this.soilParticlesGroup = CodeUtil.getName(domain.getSoilParticlesGroup());
        // 土壤电阻率
        this.soilResistivity = domain.getSoilResistivity();
        // 土壤取样编号
        this.soilSamplingNumber = domain.getSoilSamplingNumber();
        // 地形地貌描述
        this.terrainGeomorphology = domain.getTerrainGeomorphology();
        // 土壤分层描述
        this.soilLayer = domain.getSoilLayer();

        // 赋值
        super.fromDomain(domain.getId(), domain.getCreateRemark());
    }
}